function changePageAndSubmit(page){
	$("#query_page").val(page);
	$("#submitForm").submit();
}
function changeAreaAndSubmit(areaId){
	$("#query_areaId").val(areaId);
	$("#submitForm").submit();
}
function selectDateAndSubmit(dataAmount){
	$("#query_days").val(dataAmount);
	$("#submitForm").submit();
}
$(function() {
	
	$("#gotoPage1").keypress(function(event){
		if(event.keyCode=="13"){
			var reg= /^[1-9]{1}[0-9]{0,3}$/;
			if(!reg.test($(this).val())){
				alert("页码只能是1-9999之间的数字");
			}else{
				changePageAndSubmit($(this).val());
			}
		}
	});
	$("#gotoPage2").keypress(function(event){
		if(event.keyCode=="13"){
			var reg= /^[1-9]{1}[0-9]{0,3}$/;
			if(!reg.test($(this).val())){
				alert("页码只能是1-9999之间的数字");
			}else{
				changePageAndSubmit($(this).val());
			}
		}
	});
	var timeOut;
	$('#fatieshijian_a').mouseover(function() {
		// t = setTimeout("show()",2000);
		$('#fatieshijian_div').css("display", "block");
		removeChangeClass('fatieshijian_a');
	}).mouseout(function() {
		// clearTimeout(t);
		timeOut = setTimeout(function() {
			$('#fatieshijian_div').css("display", "none");
			addChangeClass('fatieshijian_a');
		}, 100);
		$('#fatieshijian_div').mouseover(function() {
			$('#fatieshijian_div').css("display", "block");
			removeChangeClass('fatieshijian_a');
			clearTimeout(timeOut);
		}).mouseout(function() {
			$('#fatieshijian_div').css("display", "none");
			addChangeClass('fatieshijian_a');
		});
	});
	$('#quanbushijian_a').mouseover(function() {
		// t = setTimeout("show()",2000);
		$('#quanbushijian_div').css("display", "block");
		removeChangeClass('quanbushijian_a');
	}).mouseout(function() {
		// clearTimeout(t);
		timeOut = setTimeout(function() {
			$('#quanbushijian_div').css("display", "none");
			addChangeClass('quanbushijian_a');
		}, 100);
		$('#quanbushijian_div').mouseover(function() {
			$('#quanbushijian_div').css("display", "block");
			removeChangeClass('quanbushijian_a');
			clearTimeout(timeOut);
		}).mouseout(function() {
			$('#quanbushijian_div').css("display", "none");
			addChangeClass('quanbushijian_a');
		});
	});
	// 切换样式的方法
	function addChangeClass(id) {
		$('#' + id + ' em').css('top', '-2px').css('border-color',
				'#666666 transparent transparent').css('border-style',
				'solid dashed dashed');
	}
	// 切换样式的方法
	function removeChangeClass(id) {
		$('#' + id + ' em').css('top', '-6px').css('border-color',
				'transparent transparent #666666  transparent').css(
				'border-style', 'dashed dashed solid dashed');
	}
});
